home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power Tools for Macintosh
/
Power Tools for Macintosh (SoftBit)(1992).iso
/
Applications
/
Alpha 4.01
/
AlphaBits
< prev
next >
Wrap
Text File
|
1991-10-18
|
18KB
|
764 lines
;====== Machine-independent portion =================================
(ascii 28 <c> scrollLeftCol)
(ascii 29 <c> scrollRightCol)
(ascii 09 doTab)
(ascii 96 startEscape) ; the backquote key
(ascii 27 startEscape) ; the MacII escape key
(bind ' ' <z> indentLine)
(bind 's' <zoc> spacesToTabs)
(bind 't' <zoc> tabsToSpaces)
(bind 'a' <zo> insertAscii)
(bind 'a' <zos> getAscii)
(bind 'l' <xo> currentPosition)
(bind 'f' <co> freeMem)
(bind '}' <s> electricRightBrace)
(bind '{' <s> electricLeftBrace)
(bind ';' doElectricSemi)
(bind 'u' <x> upcaseRegion)
(bind 'd' <x> downcaseRegion)
(bind 'c' <x> capitalizeRegion)
(bind 'd' <zx> deleteSelection)
(bind 'l' <x> currentPosition)
(bind 'r' <e> repeatSearchBackward)
(bind 's' <e> repeatSearchForward)
(bind ' ' <e> oneSpace)
(bind '\0f' <z> repeatSearchBackward)
(bind '\01' <z> repeatSearchForward)
(bind '(' <sx> startKeyboardMacro)
(bind ')' <sx> endKeyboardMacro)
(bind 'e' <x> executeKeyboardMacro)
(bind 'n' <x> nextWindow)
(bind 'p' <x> prevWindow)
(bind 'x' <x> exchangePointAndMark)
(bind 'x' <zx> exchangePointAndMark)
(bind 'j' <e> fillRegion)
(bind 'p' <e> fillParagraph)
(bind 'b' <e> backwardWord)
(bind 'd' <e> deleteWord)
(bind 'f' <e> forwardWord)
(bind 'g' <e> gotoLine)
(bind 'h' <e> backwardDeleteWord)
(bind '<' <se> beginningOfBuffer)
(bind '>' <se> endOfBuffer)
(bind 't' <e> findTag)
(bind 'k' <e> keyCode)
(bind 'l' <e> downcaseWord)
(bind 'u' <e> upcaseWord)
(bind 'c' <e> capitalizeWord)
(set useBWWindows off) ; My IIsi is just too freaking slow.
(set optionIsMeta on)
(set numWinsToTile 2)
(set electricSemi on)
(set elecLBrace on)
(set elecRBrace on)
(set fontSize 9)
(set defaultFont "monaco")
(set defWidth 506)
(set defHeight 600) ; 336 for classic mac, 600 otherwise
(set fullScreen on)
(set fillColumn 75)
(set useBackupFolder off)
(set saveOnSwitch off)
(set keepBackup off)
(set paraColumn 140)
(set posActivate off)
(set startWithNew 2)
(set paraBegin "^[ \t]*\r")
(set paraEnd "\r[ \t]*$")
(set backupFolder "External:C:Alpha:back")
(set currFileSet "edit")
(set includePath ":C:Think:Mac #includes;:C:Think:C Libraries:headers;;")
; (set funcExpr "^[^ \t\(#\r/@].*\(.*\)?$") ; use for C++ method definitions.
(set funcExpr "^[^ \t\(#\r/@].*\(.*\)$")
(set tagFile "External:C:Alpha:Alpha Proj:cTAGS")
(set protoFile "External:C:Alpha:EditSource:protos.h")
; Hooks for file suffixs. Executed on opens and activates.
(suffixHook ".tex" setTexMode)
(suffixHook ".c" setCMode)
; Color support
(colors (-20481 2703 2703) (-632 -588 -11060)) ; Sample colors
;(colors (0 0 0) (-588 -818 -1507)) ; Black and white
; Example macros
(define quoteLine
beginningOfLine
type "> "
nextLine
beginningOfLine
)
(bind '\0c' <o> quoteLine)
(define quoteLastWord
backwardWord
type "'"
forwardWord
type "'"
)
(define zapToChar
mark "start"
winSearch
goto "start"
cut)
(define normalLeftBracket
type "{"
)
(define normalRightBracket
type "}"
)
(define normalSemiColon
type ";"
)
(define carriageReturn
type "\r")
(define newBlock
electricLeftBrace
carriageReturn
electricRightBrace
previousLine
previousLine
endOfLine)
(define hiliteCurrWord
forwardWord
setMark
backwardWord
markHilite
)
; This macro is useful in finding the definition of a local variable.
(define localDef
saveVars ; Save variables' values.
hiliteCurrWord
copyclip "word" ; Copy selected text to clipboard 'word'
set forward off ; Kludged search for beginning of proc.
set regExpr on
search "^{"
set forward on
set regExpr off
set matchWords on
clipsearch "word" ; Use the contents of the clipboard 'word'
; to search for our variable.
restoreVars ; Restore the variables' original values.
)
(define globalDef
saveVars
hiliteCurrWord
copyclip "word"
beginningOfBuffer
set forward on
set regExpr off
set matchWords on
clipsearch "word"
restoreVars)
; This macro is included as an example. I doubt it is too useful in and of
; itself :-).
(define commentWord
mark "one"
hiliteCurrWord ; Hilite the current word
backwardChar ; This de-selects the word and moves the
; insertion point to the start. Deselecting
; also always sets the mark at the end of the
; selected text.
type "/* "
exchangePointAndMark
type " */"
goto "one")
(define commentLine
mark "one"
beginningOfLine
type "/* "
endOfLine
type " */"
goto "one")
(define commentBox
acmd "Comment Box")
(define uncommentBox
set matchWords 0
set forward 0
set regExpr 0
set ignoreCase 1
search "/*"
beginningOfLine
mark "one"
set matchWords 0
set forward 1
set regExpr 0
set ignoreCase 1
search "*/"
endOfLine
nextLine
beginningOfLine
goto "one"
markHilite
acmd "UnComment Box"
)
(define transposeWords
forwardWord
setMark
backwardWord
cut
deleteChar
forwardWord
type " "
paste
)
(define transposeChars
setMark
forwardChar
cut
backwardChar
paste
forwardChar
)
(define lineToParagraph
saveVars
set fillColumn 10000
set leftFillColumn 0
fillRegion
restoreVars)
(define short
set defHeight 200)
(bind 's' <cz> short)
(define paragraphToLine
saveVars
set fillColumn 75
set leftFillColumn 0
fillRegion
restoreVars)
(define nextFunc
saveVars
forwardChar
set regExpr on
set forward on
set ignoreCase on
search "^[^ \t\(#\r/@].*\(.*\)$"
restoreVars)
(define prevFunc
saveVars
2 backwardChar
set regExpr on
set forward off
set ignoreCase on
search "^[^ \t\(#\r/@].*\(.*\)$"
restoreVars)
(define setCMode
set elecLBrace 1
set elecRBrace 1
set electricSemi 1
set wordWrap 0)
(define textMode
set elecLBrace 0
set elecRBrace 0
set electricSemi 0
set wordWrap 1
set fillColumn 75
set paraBegin "^[ \t]*\r"
set paraEnd "\r[ \t]*$"
set leftFillColumn 0)
; LaTeX stuff
(define setTexMode
set elecLBrace 0
set elecRBrace 0
set electricSemi 0
set wordWrap 1
set fillColumn 75
set paraBegin "(^[ \t]*\r|\r\\.*)"
set paraEnd "\r([ \t]*$|\\.*)"
set prefixString "% "
(bind '\79' nextSection)
(bind '\74' prevSection)
set leftFillColumn 0)
(define nextSection
saveVars
set regExpr on
set forward on
forwardChar
search "\\(sub)?section"
setMark
endOfLine
markHilite
restoreVars)
(define prevSection
saveVars
set regExpr on
set forward off
setMark ; unhilites text if currently hilited
backwardChar
search "\\(sub)?section"
setMark
endOfLine
markHilite
restoreVars)
#define KEYPAD
#ifdef KEYPAD
(bind '\56' backwardWord) ; Keypad 4
(bind '\56' <c> backwardDeleteWord)
(bind '\58' forwardWord) ; Keypad 6
(bind '\58' <c> deleteWord)
(bind '\47' insertToTop) ; Keypad Clear
; Never bind Keypad /
; Never bind Keypad *
(bind '\52' pageBack) ; Keypad 0
(bind '\4c' pageForward) ; Keypad Enter
(bind '\55' repeatSearchForward) ; Keypad 3
(bind '\53' repeatSearchBackward) ; Keypad 1
(bind '\53' <c> prevFunc) ; ^Keypad 1
(bind '\55' <c> nextFunc) ; ^Keypad 3
(bind '\54' winSearch) ; Keypad 2
(bind '\41' endOfBuffer) ; Keypad .
(bind '\57' exchangePointAndMark) ; Keypad 5
(bind '\59' backwardDeleteWord) ; Keypad 7
(bind '\5c' deleteWord) ; Keypad 9
#endif KEYPAD
;====== Machine-dependent portion =================================
#define MACII
#ifdef MACII
(ascii 28 backwardChar) ; left arrow
(ascii 28 <z> beginningOfLine)
(ascii 28 <s> backwardCharSelect)
(ascii 28 <sz> beginningLineSelect)
(ascii 29 forwardChar) ; right arrow
(ascii 29 <z> endOfLine)
(ascii 29 <s> forwardCharSelect)
(ascii 29 <sz> endLineSelect)
(ascii 30 previousLine) ; up arrow
(ascii 30 <s> prevLineSelect)
(ascii 30 <z> beginningOfBuffer)
(ascii 30 <sz> beginningBufferSelect)
(ascii 30 <c> scrollUpLine)
(ascii 31 nextLine) ; down arrow
(ascii 31 <z> endOfBuffer)
(ascii 31 <s> nextLineSelect)
(ascii 31 <sz> endBufferSelect)
(ascii 31 <c> scrollDownLine)
(bind 'c' <zc> commentBox)
(bind 'u' <zc> uncommentBox)
(bind ''' <z> quoteLastWord)
(bind '[' <zs> normalLeftBracket)
(bind ']' <zs> normalRightBracket)
(bind ';' <z> normalSemiColon)
(bind '{' <se> newBlock)
(bind 'h' <z> hiliteCurrWord)
;(bind '\1e' <sz> matchBrace)
(bind 's' <z> winSearch)
(bind 'a' <z> beginningOfLine)
(bind 'b' <z> backwardChar)
(bind 'd' <z> deleteChar)
(bind 'f' <z> forwardChar)
(bind 'e' <z> endOfLine)
(bind 'g' <z> abortEm)
(bind 'k' <z> killLine)
(bind 'l' <z> centerRedraw)
(bind 't' <z> insertToTop)
(bind 'p' <z> previousLine)
(bind 'n' <z> nextLine)
(bind 'o' <z> openLine)
(bind 'u' <z> iterationCount)
(bind 'v' <z> pageForward)
(bind 'z' <z> pageBack)
(bind 'v' <e> pageBack)
(bind 'w' <z> cut)
(bind 'w' <e> copy)
(bind ' ' <z> setMark)
(bind 'x' <z> prefixChar)
(bind 'y' <z> yank)
(bind '\7a' setMark) ; F1
(bind '\78' copy) ; F2
(bind '\63' cut) ; F3
(bind '\76' yank) ; F4
(bind '\60' findFile) ; F5
(bind '\61' nextWindow) ; F6
(bind '\62' prevWindow) ; F7
(bind '\64' doSave) ; F8
(bind '\65' winSearch) ; F9
(bind '\6d' repeatSearchBackward) ; F10
(bind '\67' repeatSearchForward) ; F11
(bind '\6f' doZoom) ; F12
(bind '\69' startKeyboardMacro) ; F13
(bind '\6b' endKeyboardMacro) ; F14
(bind '\71' executeKeyboardMacro) ; F15
(bind '\75' deleteChar) ; 'del' key
(bind '\72' alphaHelp) ; 'help' key
(bind '\73' beginningOfBuffer) ; 'home'
(bind '\77' endOfBuffer) ; 'end'
(bind '\74' pageBack) ; 'page up'
(bind '\79' pageForward) ; 'page down'
#else MACII
(bind '\51' findFile) ; F1
(bind '\60' doSave) ; F6
(bind '\63' killWindow) ; F7
(bind '\64' nextWindow) ; F8
(bind '\65' fillParagraph) ; F9
(bind '\69' setMark) ; F10
(bind '\6a' copy) ; F11
(bind '\6a' <c> cut) ; cmd-F11
(bind '\6b' doZoom) ; F12
(bind '\6f' startKeyboardMacro) ; F13
(bind '\70' endKeyboardMacro) ; F14
(bind '\71' executeKeyboardMacro) ; F15
(ascii 28 backwardChar) ; left arrow
(ascii 28 <o> beginningOfLine)
;(ascii 43 <s> backwardCharSelect)
;(ascii 43 <so> beginningLineSelect)
(bind '\46' <s> backwardCharSelect)
(bind '\46' <so> beginningLineSelect)
(ascii 29 forwardChar) ; right arrow
(ascii 29 <o> endOfLine)
;(ascii 42 <s> forwardCharSelect)
;(ascii 42 <so> endLineSelect)
(bind '\42' <s> forwardCharSelect)
(bind '\42' <so> endLineSelect)
(ascii 30 previousLine) ; up arrow
(ascii 30 <o> beginningOfBuffer)
(ascii 30 <c> scrollUpLine)
;(ascii 47 <s> prevLineSelect)
;(ascii 47 <so> beginningBufferSelect)
(bind '\4d' <s> prevLineSelect)
(bind '\4d' <so> beginningBufferSelect)
(ascii 31 nextLine) ; down arrow
(ascii 31 <o> endOfBuffer)
(ascii 31 <c> scrollDownLine)
;(ascii 61 <s> nextLineSelect)
;(ascii 61 <so> endBufferSelect)
(bind '\48' <s> nextLineSelect)
(bind '\48' <so> endBufferSelect)
(bind 'c' <oc> commentBox)
(bind 'u' <oc> uncommentBox)
(bind ''' <o> quoteLastWord)
(bind '[' <os> normalLeftBracket)
(bind ']' <os> normalRightBracket)
(bind ';' <o> normalSemiColon)
(bind '{' <se> newBlock)
(bind 'h' <o> hiliteCurrWord)
;(bind '\1e' <so> matchBrace)
(bind 's' <o> winSearch)
(bind 'a' <o> beginningOfLine)
(bind 'b' <o> backwardChar)
(bind 'd' <o> deleteChar)
(bind 'f' <o> forwardChar)
(bind 'e' <o> endOfLine)
(bind 'g' <o> abortEm)
(bind 'k' <o> killLine)
(bind 't' <o> insertToTop)
(bind 'l' <o> centerRedraw)
(bind 'l' <oc> moveInsertionHere)
(bind 'p' <o> previousLine)
(bind 'n' <o> nextLine)
(bind 'o' <o> openLine)
(bind 'u' <o> iterationCount)
(bind 'v' <o> pageForward)
(bind 'z' <o> pageBack)
(bind 'v' <e> pageBack)
(bind 'w' <o> cut)
(bind 'w' <e> copy)
(bind ' ' <o> setMark)
(bind 'x' <o> prefixChar)
(bind 'y' <o> yank)
#endif MACII
; My menus
(define loadDewarFile
loadFile ":LaTeX:Dewar Macros:dewarLatex")
(define loadWrightFile
loadFile ":LaTeX:Wright Macros:wrightMacros")
(menu Utils
"shortMenus"
"FLAGMENU"
"VARMENU"
"MACROMENU"
"ACMDMENU"
(menu FUtils
"insertFile"
"(-"
"fileRemove/\"
"fileInfo/=")
"FSETMENU"
"(-"
"execute/'"
"protoFile"
"protoFileSet"
(menu LaTeXs
"loadDewarFile"
"loadWrightFile")
"(-"
"startKeyboardMacro"
"endKeyboardMacro"
"executeKeyboardMacro"
"dumpMacro")
(menu Utilities
"longMenus"
"FLAGMENU"
"VARMENU"
"MACROMENU"
"ACMDMENU"
(menu FUtils
"insertFile"
"(-"
"fileRemove/\"
"fileInfo/=")
"FSETMENU"
"(-"
"TILEMENU"
"doZoom//")
(menu Misc
"keyAscii"
"getAscii"
"insertAscii"
"(-"
"keyCode"
"describeKey"
"listCustomization"
"getPathName"
"setFontsTabs"
"(-"
"/,setCMode"
"/.setTexMode"
"(-"
"hiliteCurrWord")
(menu Convert
"fillRegion"
"fillParagraph"
"(-"
"zapInvisibles"
"tabsToSpaces"
"spacesToTabs"
"(-"
(menu Strings
"insertPrefix"
"insertSuffix"
"removePrefix"
"removeSuffix")
#ifdef MACII
(menu Colors
"foreColor"
"backColor"
"dumpColors")
#endif MACII
"(-"
"ParagraphToLine"
"LineToParagraph"
"(-"
"commentBox"
"uncommentBox"
"transposeChars"
"transposeWords")
(menu Wins
"TILEMENU"
"//doZoom"
"nextWindow"
"prevWindow"
"closeAll"
"saveAll"
"(-"
"WINDOWMENU")
(insertMenu "Utils")
(insertMenu "Misc")
(insertMenu "Convert")
(insertMenu "Wins")
(define shortMenus
deleteMenu "Utils"
deleteMenu "Misc"
deleteMenu "Convert"
deleteMenu "Wins"
insertMenu "Utilities")
(define longMenus
insertMenu "Utils"
insertMenu "Misc"
insertMenu "Convert"
insertMenu "Wins"
deleteMenu "Utilities")
; Obviously, you won't use these file sets, but they are an example.
(fileSet edit
"External:C:Alpha:EditSource:io.c"
"External:C:Alpha:EditSource:key.c"
"External:C:Alpha:EditSource:lex.yy.c"
"External:C:Alpha:EditSource:utl.c"
"External:C:Alpha:EditSource:alloca.c"
"External:C:Alpha:EditSource:hlp.c"
"External:C:Alpha:EditSource:main.c"
"External:C:Alpha:EditSource:misc.c"
"External:C:Alpha:EditSource:redraw.c"
"External:C:Alpha:EditSource:search.c"
"External:C:Alpha:EditSource:text.c"
"External:C:Alpha:EditSource:undo.c"
"External:C:Alpha:EditSource:rep.c"
"External:C:Alpha:EditSource:windows.c"
"External:C:Alpha:EditSource:options.c"
"External:C:Alpha:EditSource:command.c"
"External:C:Alpha:EditSource:regexp.c"
"External:C:Alpha:EditSource:acmds.c"
"External:C:Alpha:EditSource:frills.c"
"External:C:Alpha:EditSource:varargs.c"
"External:C:Alpha:EditSource:proto.c"
"External:C:Alpha:EditSource:getDir.c"
"External:C:Alpha:EditSource:bindings.c"
"External:C:Alpha:EditSource:dir.c"
"External:C:Alpha:EditSource:file_set.c"
"External:C:Alpha:EditSource:emacs.c"
"External:C:Alpha:EditSource:alpha.tab.c"
)
(fileSet toProto
"External:C:Alpha:EditSource:undo.c"
"External:C:Alpha:EditSource:dir.c"
"External:C:Alpha:EditSource:acmds.c"
"External:C:Alpha:EditSource:bindings.c"
"External:C:Alpha:EditSource:emacs.c"
"External:C:Alpha:EditSource:file_set.c"
"External:C:Alpha:EditSource:frills.c"
"External:C:Alpha:EditSource:getDir.c"
"External:C:Alpha:EditSource:io.c"
"External:C:Alpha:EditSource:key.c"
"External:C:Alpha:EditSource:main.c"
"External:C:Alpha:EditSource:misc.c"
"External:C:Alpha:EditSource:options.c"
"External:C:Alpha:EditSource:port.c"
"External:C:Alpha:EditSource:redraw.c"
"External:C:Alpha:EditSource:search.c"
"External:C:Alpha:EditSource:text.c"
"External:C:Alpha:EditSource:windows.c"
"External:C:Alpha:EditSource:command.c"
"External:C:Alpha:EditSource:hlp.c"
"External:C:Alpha:EditSource:rep.c"
"External:C:Alpha:EditSource:utl.c"
)
(special
"External:fig1.ps"
"External:C:Alpha:Alpha Proj:AlphaBits/;"
"External:C:Alpha:EditSource:acmds.c"
"External:C:Alpha:EditSource:Chnges"
"External:C:Alpha:Alpha Proj:AlphaHelp.t"
"External:C:Alpha:EditSource:frills.c"
"External:C:Alpha:EditSource:Alpha.h"
"External:oz:study:study.tex")
(fileSet includes
"External:C:THINK C:Mac #includes:Controls.h"
"External:C:THINK C:Mac #includes:Desk.h"
"External:C:THINK C:Mac #includes:DeskBus.h"
"External:C:THINK C:Mac #includes:Devices.h"
"External:C:THINK C:Mac #includes:Dialogs.h"
"External:C:THINK C:Mac #includes:DiskInit.h"
"External:C:THINK C:Mac #includes:Errors.h"
"External:C:THINK C:Mac #includes:Events.h"
"External:C:THINK C:Mac #includes:Files.h"
"External:C:THINK C:Mac #includes:Fonts.h"
"External:C:THINK C:Mac #includes:Icons.h"
"External:C:THINK C:Mac #includes:Lists.h"
"External:C:THINK C:Mac #includes:Memory.h"
"External:C:THINK C:Mac #includes:Menus.h"
"External:C:THINK C:Mac #includes:OSEvents.h"
"External:C:THINK C:Mac #includes:OSUtils.h"
"External:C:THINK C:Mac #includes:Packages.h"
"External:C:THINK C:Mac #includes:QuickDraw.h"
"External:C:THINK C:Mac #includes:Resources.h"
"External:C:THINK C:Mac #includes:ROMDefs.h"
"External:C:THINK C:Mac #includes:Scrap.h"
"External:C:THINK C:Mac #includes:SegLoad.h"
"External:C:THINK C:Mac #includes:StandardFile.h"
"External:C:THINK C:Mac #includes:TextEdit.h"
"External:C:THINK C:Mac #includes:ToolUtils.h"
"External:C:THINK C:Mac #includes:Types.h"
"External:C:THINK C:Mac #includes:Windows.h"
"External:C:THINK C:Mac #includes:asm.h"
"External:C:THINK C:Mac #includes:pascal.h"
"External:C:THINK C:Mac #includes:Aliases.h"
"External:C:THINK C:Mac #includes:AppleEvents.h"
"External:C:THINK C:Mac #includes:GestaltEqu.h"
"External:C:THINK C:Mac #includes:Finder.h"
"External:C:THINK C:Mac #includes:Script.h"
"External:C:THINK C:Mac #includes:LoMem.h"
"External:C:THINK C:C Libraries:headers:string.h"
"External:C:THINK C:C Libraries:headers:stdio.h"
"External:C:THINK C:C Libraries:headers:unix.h"
"External:C:THINK C:C Libraries:headers:stddef.h"
"External:C:THINK C:C Libraries:headers:math.h"
"External:C:THINK C:C Libraries:headers:errno.h"
"External:C:THINK C:C Libraries:headers:stdlib.h"
"External:C:THINK C:C Libraries:headers:ctype.h"
"External:C:THINK C:C Libraries:headers:pascal.h"
"External:C:THINK C:C Libraries:headers:stdarg.h"
"External:C:Alpha:EditSource:Alpha.h"
"External:C:Alpha:EditSource:alpha.tab.h"
"External:C:Alpha:EditSource:protos.h"
)